package cn.smart.rest.controller;

import cn.smart.pojo.Fgroup;
import cn.smart.service.FgroupService;
import cn.smart.util.SmartResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/fgroup")
public class FgroupController {
    @Autowired
    private FgroupService fgroupService;
    //创建一个新花组
    @RequestMapping(value = "/add")
    @ResponseBody
    public SmartResult addFgroup(Fgroup fgroup){
        return fgroupService.insertFgroup(fgroup);
    }
    //删除一个花组
    @ResponseBody
    @RequestMapping("/remove/{id}")
    public SmartResult removeFgroup(@PathVariable(value = "id") int fgid){
        return fgroupService.deleteFgroup(fgid);
    }
    //更新花组
    @ResponseBody
    @RequestMapping(value = "/update")
    public SmartResult updateFgroup(Fgroup fgroup){

        return null;
    }
}
